package com.example.backblog.service.blog.impl;

import com.example.backblog.entity.blog.Tag;
import com.example.backblog.repository.blog.TagRepository;
import com.example.backblog.service.blog.TagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@CacheConfig(cacheNames = {"tagService"})
public class TagServiceImpl implements TagService {
    @Autowired
    private TagRepository tagRepository;
    @Cacheable(cacheNames = "listAll1")
    @Override
    public List<Tag> listAll() {
        return tagRepository.findAll();
    }
    // 缓存getALL

}
